Skip to content

Guard strategy choices by account domain#18

Merged
Pigbibi merged 1 commit into
mainfrom
codex/strategy-domain-guardrails
Jun 9, 2026
Merged

Guard strategy choices by account domain#18
Pigbibi merged 1 commit into
mainfrom
codex/strategy-domain-guardrails

Conversation

@Pigbibi

@Pigbibi Pigbibi commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add account-level supported_domains and strategy-profile domain validation
  • filter strategy choices per selected account in the switch console
  • reject unsupported platform/account/strategy combinations in the Worker switch endpoint
  • document the profile/domain alignment rule and add a Worker validation test

Tests

  • python3 scripts/runtime_settings.py validate
  • python3 -m unittest discover -s tests -v
  • node --experimental-default-type=module tests/strategy_switch_worker_validation.mjs
  • strategy switch web asset syntax checks

@Pigbibi Pigbibi merged commit d23eaf8 into main Jun 9, 2026
2 checks passed
@Pigbibi Pigbibi deleted the codex/strategy-domain-guardrails branch June 9, 2026 06:22

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6c4475c1e2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

strip.innerHTML = "";
for (const platform of Object.keys(platformMeta)) {
ensureAccountSelection(platform);
syncStrategyForAccount(platform);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Preserve the selected strategy during rerenders

When the strategy dropdown change handler stores the user's choice and calls render(), renderPlatforms() now runs syncStrategyForAccount() for every platform before the controls are drawn. For accounts with a current or default_strategy_profile, defaultStrategyForAccount(..., state.forms[platform].strategy) prefers that current/default profile over the fallback user selection, so any non-default supported strategy is immediately overwritten and cannot be dispatched from the UI.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant